openclaw telemetry: capture tlon tool call summaries#5934
Conversation
Layers in processing to capture context around which `tlon` commands were used in tool calls. Adds compact, filterable actions like `groups.invite`, `contacts.update-profile`, and `groups.add-channel`, while preserving the existing top-level reply telemetry. - shared tlon command parser/classifier mapping commands to privacy-safe summary keys - `summaryKey` on individual `toolCalls[]` entries to correlate action type with `durationMs` - top-level facets: `tlonToolCallCount`, `tlonToolSummaryKeys`, `tlonToolChannelKinds`, `tlonToolUpdateFields` Migrated from tloncorp/openclaw-tlon#124 (originally authored by ~latter-bolden, approved by @arthyn). Rebased onto current master and relocated to packages/openclaw under monorepo conventions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e1b8b02f2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const operation = hasAction | ||
| ? commandArgs[1]?.toLowerCase() ?? defaultOperationForSubcommand(subcommand) | ||
| : defaultOperationForSubcommand(subcommand); |
There was a problem hiding this comment.
Normalize unknown tlon operations before telemetry
When a known tlon family is invoked with a mistyped or missing operation, e.g. tlon groups "Launch Planning", this takes commandArgs[1] as the operation and later emits it in summaryKey/operation (groups.launch planning) and tlonToolSummaryKeys. That sends arbitrary user text to PostHog even though the CLI will only reject the command, defeating the privacy-safe telemetry goal; collapse unrecognized operations to a fixed value before recording them.
Useful? React with 👍 / 👎.
|
thanks for carrying this over! I'll take a look and make sure claw and hermes both log analogously |
Originally posted by @latter-bolden in the openclaw-tlon repo.
Layers in processing to capture context around which
tloncommands were used in tool calls. Adds compact, filterable actions likegroups.invite,contacts.update-profile, andgroups.add-channel, while preserving the existing top-level reply telemetry.Changes
packages/openclaw/src/tlon-tool-command.ts) that maps tlon commands to privacy-safe summary keyssummaryKeyto individualtoolCalls[]entries so we can correlate action type withdurationMstlonToolCallCount,tlonToolSummaryKeys,tlonToolChannelKinds,tlonToolUpdateFieldsMigration note
Migrated from tloncorp/openclaw-tlon#124 (originally authored by ~latter-bolden, approved by @arthyn) as part of consolidating the OpenClaw Tlon plugin into this monorepo. Rebased onto current
masterand relocated topackages/openclawunder monorepo conventions.One incidental, undocumented change in the original PR (
await this.client.shutdown()in telemetryclose()) was dropped in favor of master's deliberatevoid this.client.shutdown()(from openclaw-tlon commit0f48100d).Test plan
pnpm tsc --noEmitcleanpnpm testinpackages/openclaw)--checkclean on all touched files